package A1_1;

public class Thoroughbred {
    private String mother;
    private String father;
    private int birthyear;

    //构造函数
    public Thoroughbred(String mother, String father, int birthyear){
        this.mother = mother;
        this.father = father;
        this.birthyear = birthyear;
    }

    //获取母亲名字操作
    public String getMother(){
        return mother;
    }

    //获取父亲名字操作
    public String getFather(){
        return father;
    }

    //获取当前年龄操作
    public int getCurrentAge(){
        int currentYear = java.time.Year.now().getValue();//获取当前年份
        return currentYear - birthyear;
    }
}